const mongoose = require("mongoose");
// import userModel from "./userModel";
const userModel = require('./userModel')

async function main(params) {
  await mongoose.connect("mongodb://127.0.0.1:27017/expressvideo");
}
// console.log('执行数据库链接')
main()
  .then((res) => {
    console.log("mongo connect success!");
  })
  .catch((err) => {
    console.log("db---error", err);
  });

module.exports = {
  User: mongoose.model("User", userModel),
};
